/* ============================================================
   NexVerse — Eşsiz UI Tasarımı
   Tema: Kozmik / Metaverse vibes
   ============================================================ */

/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #060610;
  --surface:   #0e0e1f;
  --surface2:  #13132a;
  --glass-bg:  rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --purple:    #a855f7;
  --purple-d:  #7c3aed;
  --cyan:      #06b6d4;
  --pink:      #ec4899;
  --green:     #22c55e;
  --text:      #f1f1f5;
  --text-2:    #a0a0c0;
  --text-3:    #5a5a7a;
  --radius:    16px;
  --radius-sm: 10px;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
  --sidebar-w: 260px;
  --right-w:   300px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
}

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--purple-d); border-radius: 99px; }

/* ─── AURORA BACKGROUND ─────────────────────────────────────── */
.aurora {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.aurora__layer {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.15;
  animation: aurora-drift 18s ease-in-out infinite;
}
.aurora__layer--1 {
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, #a855f7, transparent 70%);
  top: -20%; left: -10%;
  animation-duration: 20s;
}
.aurora__layer--2 {
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: -15%; right: -10%;
  animation-duration: 25s; animation-delay: -8s;
}
.aurora__layer--3 {
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  top: 40%; left: 40%;
  animation-duration: 30s; animation-delay: -15s;
}
@keyframes aurora-drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(5%,5%) scale(1.1); }
  66% { transform: translate(-3%,3%) scale(0.95); }
}

/* ─── GLASS ─────────────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ─── AUTH SCREEN ────────────────────────────────────────────── */
.screen--auth {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; position: relative; z-index: 10; padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px;
  border-radius: 24px; padding: 40px 36px;
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(168,85,247,0.08) 0%, rgba(6,182,212,0.05) 100%);
  pointer-events: none;
}
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-brand__logo { width: 56px; height: 56px; filter: drop-shadow(0 0 20px rgba(168,85,247,0.5)); }
.auth-brand__name {
  display: block; font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: -0.5px; margin-top: 8px;
}
.auth-brand__tagline { color: var(--text-2); font-size: 13px; margin-top: 4px; }

.auth-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; border: none; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  padding: 10px; border-radius: 9px; cursor: pointer;
  transition: var(--transition);
}
.auth-tab--active {
  background: linear-gradient(135deg, var(--purple-d), #0891b2);
  color: #fff; box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field__input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text); font-size: 14px; outline: none;
  transition: var(--transition);
}
.field__input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
  background: rgba(168,85,247,0.05);
}
.field__prefix-wrap { display: flex; align-items: center; }
.field__prefix {
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 12px 12px; color: var(--text-2); font-size: 14px;
}
.field__input--prefix { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; flex: 1; }

.auth-divider {
  text-align: center; color: var(--text-3); font-size: 13px;
  position: relative; margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 42%;
  height: 1px; background: var(--glass-border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: #f87171; font-size: 13px; margin-top: 8px;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; border-radius: 99px;
  padding: 11px 22px; transition: var(--transition);
  position: relative; overflow: hidden; text-decoration: none;
}
.btn--primary {
  background: linear-gradient(135deg, var(--purple-d), #0891b2);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(124,58,237,0.5);
}
.btn--primary:active { transform: translateY(0); }
.btn__shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  transform: translateX(-100%);
}
.btn--primary:hover .btn__shimmer { animation: shimmer 0.6s ease; }
@keyframes shimmer { to { transform: translateX(100%); } }

.btn--google {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border); color: var(--text);
}
.btn--google:hover { background: rgba(255,255,255,0.1); }

.btn--ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border); color: var(--text-2);
}
.btn--ghost:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.btn--full { width: 100%; }
.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn--icon {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border); color: var(--text-2);
}
.btn--icon:hover { background: rgba(168,85,247,0.15); color: var(--purple); }

/* ─── APP LAYOUT ─────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  min-height: 100dvh; position: relative; z-index: 1;
}

/* ─── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column; padding: 24px 16px;
  gap: 8px; z-index: 100;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 8px;
}
.sidebar__brand-name {
  font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-list { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border: none; background: transparent;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition); position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.nav-item--active {
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(8,145,178,0.15));
  color: var(--purple); border: 1px solid rgba(168,85,247,0.2);
}
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--purple);
  color: #fff; font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px; letter-spacing: 0.5px;
}
.nav-badge--msg { background: var(--pink); }

.btn--post {
  border-radius: var(--radius); padding: 14px;
  font-size: 15px; margin-top: 8px;
}

.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03); margin-top: auto; cursor: pointer;
}
.sidebar__user:hover { background: rgba(255,255,255,0.06); }
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-handle { font-size: 12px; color: var(--text-2); }
.sidebar__logout {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 6px; border-radius: 6px; transition: var(--transition);
}
.sidebar__logout:hover { color: #f87171; background: rgba(239,68,68,0.1); }

/* ─── MOBILE NAV ─────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px; z-index: 200;
  border-top: 1px solid var(--glass-border);
  align-items: center; justify-content: space-around;
  padding: 0 8px;
}
.mob-nav-item {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; background: transparent;
  cursor: pointer; border-radius: 50%; transition: var(--transition);
  color: var(--text-2);
}
.mob-nav-item svg { width: 22px; height: 22px; }
.mob-nav-item:hover, .mob-nav-item--active { color: var(--purple); }
.mob-nav-center {
  background: linear-gradient(135deg, var(--purple-d), #0891b2);
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
}

/* ─── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
  max-width: 620px; width: 100%;
  border-right: 1px solid var(--glass-border);
  min-height: 100dvh;
}

.page { display: none; min-height: 100dvh; }
.page--active { display: block; }

/* ─── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  position: sticky; top: 0; z-index: 50;
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
}
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }

.feed-tabs { display: flex; gap: 0; margin-top: 12px; border-bottom: 1px solid var(--glass-border); }
.feed-tab {
  flex: 1; border: none; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  padding: 12px; cursor: pointer; transition: var(--transition);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.feed-tab--active { color: var(--text); border-bottom-color: var(--purple); }

/* ─── COMPOSE ────────────────────────────────────────────────── */
.compose-card {
  display: flex; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
}
.compose-body { flex: 1; }
.compose-input {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 16px; resize: none;
  font-family: inherit; min-height: 56px; line-height: 1.5;
}
.compose-input::placeholder { color: var(--text-3); }
.compose-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.compose-media-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; color: var(--cyan); transition: var(--transition);
}
.compose-media-btn:hover { background: rgba(6,182,212,0.1); }
.compose-preview { margin-top: 12px; }
.compose-preview img, .compose-preview video {
  max-height: 280px; width: 100%; border-radius: var(--radius-sm); object-fit: cover;
}

/* ─── FEED ───────────────────────────────────────────────────── */
.feed-list { display: flex; flex-direction: column; }

.post-card {
  border-bottom: 1px solid var(--glass-border);
  padding: 16px 20px; transition: var(--transition);
  cursor: pointer;
}
.post-card:hover { background: rgba(255,255,255,0.02); }
.post-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.post-meta { flex: 1; }
.post-display-name { font-size: 15px; font-weight: 600; }
.post-username { font-size: 13px; color: var(--text-2); }
.post-time { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.post-content { font-size: 15px; line-height: 1.6; margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }
.post-media { margin-bottom: 12px; border-radius: var(--radius-sm); overflow: hidden; }
.post-media img { width: 100%; max-height: 400px; object-fit: cover; }
.post-media video { width: 100%; max-height: 400px; border-radius: var(--radius-sm); }

.post-actions { display: flex; gap: 24px; }
.post-action {
  display: flex; align-items: center; gap: 6px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-2); font-size: 13px; padding: 6px 0;
  border-radius: 6px; transition: var(--transition);
}
.post-action:hover.action-like { color: var(--pink); }
.post-action:hover.action-comment { color: var(--cyan); }
.post-action:hover.action-repost { color: var(--green); }
.post-action.liked { color: var(--pink); }
.post-action svg { width: 18px; height: 18px; }

/* ─── AVATAR ─────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--purple-d), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0;
  overflow: hidden;
}
.avatar--sm { width: 40px; height: 40px; font-size: 16px; }
.avatar--md { width: 52px; height: 52px; font-size: 20px; }
.avatar--lg { width: 80px; height: 80px; font-size: 28px; }
.avatar--xl { width: 120px; height: 120px; font-size: 40px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ─── SKELETON ───────────────────────────────────────────────── */
.skeleton-feed { display: flex; flex-direction: column; }
.skeleton-post {
  height: 120px; margin: 0; border-bottom: 1px solid var(--glass-border);
  border-radius: 0; animation: skeleton-pulse 1.5s ease infinite;
}
@keyframes skeleton-pulse {
  0%,100% { opacity: 0.4; }
  50% { opacity: 0.15; }
}

/* ─── REELS ──────────────────────────────────────────────────── */
.reels-page { position: relative; }
.reels-container {
  height: 100dvh; overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.reels-container::-webkit-scrollbar { display: none; }

.reel-item {
  height: 100dvh; width: 100%;
  scroll-snap-align: start; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.reel-item video {
  height: 100%; width: 100%; object-fit: cover;
}
.reel-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
}
.reel-info {
  position: absolute; bottom: 80px; left: 16px; right: 80px;
}
.reel-info__user { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.reel-info__name { font-weight: 700; font-size: 15px; }
.reel-info__handle { font-size: 13px; color: rgba(255,255,255,0.7); }
.reel-info__caption { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.9); }

.reel-actions {
  position: absolute; bottom: 80px; right: 12px;
  display: flex; flex-direction: column; gap: 20px; align-items: center;
}
.reel-action {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: none; background: transparent; cursor: pointer;
  color: #fff; font-size: 13px; font-weight: 600;
}
.reel-action svg { width: 28px; height: 28px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.reel-action.liked { color: var(--pink); }

.reels-upload-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-d), #0891b2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 8px 24px rgba(124,58,237,0.4);
  z-index: 100; transition: var(--transition); color: #fff;
}
.reels-upload-fab:hover { transform: scale(1.05); }

/* ─── FRIENDS / PEOPLE ───────────────────────────────────────── */
.friends-grid { padding: 20px; }
.section-label {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-2); margin: 20px 0 12px;
}
.user-grid { display: flex; flex-direction: column; gap: 10px; }

.user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  transition: var(--transition); cursor: pointer;
}
.user-card:hover { border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.05); }
.user-card__info { flex: 1; min-width: 0; }
.user-card__name { font-size: 15px; font-weight: 600; }
.user-card__handle { font-size: 13px; color: var(--text-2); }
.follow-btn {
  padding: 8px 18px; border-radius: 99px; font-size: 13px;
  font-weight: 600; border: none; cursor: pointer; transition: var(--transition);
  background: linear-gradient(135deg, var(--purple-d), #0891b2);
  color: #fff;
}
.follow-btn--following {
  background: transparent; border: 1px solid var(--glass-border); color: var(--text-2);
}
.follow-btn--following:hover { border-color: #ef4444; color: #ef4444; }

/* ─── MESSAGES ───────────────────────────────────────────────── */
.messages-page {
  display: none; /* managed by JS */
  flex-direction: row;
  height: 100dvh;
}
.messages-page.page--active { display: flex; }
.messages-sidebar {
  width: 280px; flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column; overflow: hidden;
}
.messages-sidebar__header {
  padding: 20px 16px; border-bottom: 1px solid var(--glass-border);
}
.messages-sidebar__header h2 { font-size: 18px; font-weight: 700; }
.conversation-list { flex: 1; overflow-y: auto; }

.conversation-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; transition: var(--transition);
  border-bottom: 1px solid var(--glass-border);
}
.conversation-item:hover { background: rgba(255,255,255,0.04); }
.conversation-item--active { background: rgba(168,85,247,0.08); }
.conversation-item__info { flex: 1; min-width: 0; }
.conversation-item__name { font-size: 14px; font-weight: 600; }
.conversation-item__preview { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item__badge {
  background: var(--purple); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}

.chat-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; color: var(--text-2);
}

.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--glass-border);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.message {
  display: flex; gap: 10px; max-width: 70%;
}
.message--mine {
  flex-direction: row-reverse; align-self: flex-end;
}
.message__bubble {
  padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5;
  background: rgba(255,255,255,0.07); color: var(--text);
  border-bottom-left-radius: 4px;
}
.message--mine .message__bubble {
  background: linear-gradient(135deg, var(--purple-d), #0891b2);
  color: #fff; border-bottom-left-radius: 18px; border-bottom-right-radius: 4px;
}
.message__time { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.chat-input-area {
  padding: 16px 20px; border-top: 1px solid var(--glass-border);
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border); border-radius: 22px;
  padding: 11px 16px; color: var(--text); font-size: 14px;
  outline: none; resize: none; font-family: inherit; max-height: 120px;
  transition: var(--transition);
}
.chat-input:focus { border-color: var(--purple); }

/* ─── PROFILE ────────────────────────────────────────────────── */
.profile-cover {
  height: 180px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1e0a3c, #0a2540, #0a3040);
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(6,6,16,0.6));
}
.profile-header {
  padding: 0 24px 20px; position: relative;
}
.profile-avatar-wrap {
  margin-top: -48px; margin-bottom: 12px; position: relative; width: fit-content;
}
.profile-avatar-wrap .avatar { border: 4px solid var(--bg); }
.profile-edit-cover {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 8px; padding: 6px 12px;
  font-size: 12px; cursor: pointer; backdrop-filter: blur(8px);
}
.profile-name { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.profile-handle { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.profile-bio { font-size: 14px; line-height: 1.6; color: var(--text-2); margin-bottom: 14px; }
.profile-stats { display: flex; gap: 20px; margin-bottom: 16px; }
.profile-stat { cursor: pointer; }
.profile-stat-num { font-size: 16px; font-weight: 700; }
.profile-stat-label { font-size: 13px; color: var(--text-2); }
.profile-actions { display: flex; gap: 10px; }
.profile-tabs {
  display: flex; border-bottom: 1px solid var(--glass-border);
  padding: 0 20px;
}
.profile-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  padding: 14px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: var(--transition);
}
.profile-tab--active { color: var(--purple); border-bottom-color: var(--purple); }

/* ─── SEARCH ─────────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  border-radius: 99px; padding: 10px 16px; margin-top: 12px;
}
.search-icon { color: var(--text-3); flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px;
}
.search-results { padding: 16px 20px; gap: 10px; }

/* ─── RIGHT PANEL ────────────────────────────────────────────── */
.right-panel {
  padding: 24px 20px; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.trending { border-radius: var(--radius); padding: 18px; }
.trending__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.trending__list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.trending__item { display: flex; justify-content: space-between; align-items: center; }
.trending__tag {
  font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; cursor: pointer;
}
.trending__count { font-size: 12px; color: var(--text-3); }
.suggestions-widget { border-radius: var(--radius); padding: 18px; }
.suggestions-widget h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 540px; border-radius: 20px;
  animation: slide-up 0.22s cubic-bezier(.4,0,.2,1);
  max-height: 90dvh; overflow-y: auto;
}
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--glass-border);
}
.modal__header h2 { font-size: 17px; font-weight: 700; }
.modal__close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.06); color: var(--text-2);
  cursor: pointer; font-size: 16px; transition: var(--transition);
}
.modal__close:hover { background: rgba(239,68,68,0.15); color: #f87171; }
.modal__body { padding: 20px 24px; }
.modal__footer {
  padding: 16px 24px; border-top: 1px solid var(--glass-border);
  display: flex; justify-content: space-between; align-items: center;
}

.modal-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.modal-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04); border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.modal-tab--active {
  border-color: var(--purple); color: var(--purple);
  background: rgba(168,85,247,0.1);
}

.modal-textarea {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 14px; color: var(--text); font-size: 15px;
  resize: vertical; min-height: 100px; outline: none;
  font-family: inherit; line-height: 1.5; transition: var(--transition);
}
.modal-textarea:focus { border-color: var(--purple); }

.modal-media-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
}
.modal-media-preview img, .modal-media-preview video {
  width: 100%; max-height: 240px; object-fit: cover;
  border-radius: var(--radius-sm); margin-top: 12px;
}

.char-count { font-size: 13px; color: var(--text-3); }
.char-count--warn { color: #f97316; }
.char-count--over { color: #ef4444; }

/* ─── UPLOAD PROGRESS ─────────────────────────────────────────── */
.modal-upload-progress { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.progress-bar {
  height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px; width: 0%;
  background: linear-gradient(90deg, var(--purple-d), var(--cyan));
  transition: width 0.3s ease;
}

/* ─── REEL UPLOAD ZONE ────────────────────────────────────────── */
.reel-upload-zone {
  border: 2px dashed var(--glass-border); border-radius: var(--radius);
  padding: 40px; display: flex; flex-direction: column;
  align-items: center; gap: 10px; cursor: pointer;
  transition: var(--transition); text-align: center;
}
.reel-upload-zone:hover { border-color: var(--purple); background: rgba(168,85,247,0.05); }
.reel-upload-zone p { font-size: 15px; font-weight: 500; color: var(--text-2); }
.reel-upload-zone span { font-size: 12px; color: var(--text-3); }

/* ─── COMMENTS ────────────────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 14px; max-height: 380px; overflow-y: auto; margin-bottom: 16px; }
.comment-item { display: flex; gap: 10px; }
.comment-item__body { flex: 1; }
.comment-item__header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment-item__name { font-size: 14px; font-weight: 600; }
.comment-item__time { font-size: 12px; color: var(--text-3); }
.comment-item__text { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.comment-compose { display: flex; align-items: center; gap: 10px; }

/* ─── TOAST ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--glass-border);
  color: var(--text); font-size: 14px; font-weight: 500;
  padding: 12px 24px; border-radius: 99px; z-index: 9999;
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --right-w: 0px; }
  .right-panel { display: none; }
  #app { grid-template-columns: var(--sidebar-w) 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  #app { grid-template-columns: 1fr; }
  .main-content { max-width: 100%; border: none; padding-bottom: 64px; }
  .auth-card { padding: 28px 20px; }
  .messages-page { flex-direction: column; }
  .messages-sidebar { width: 100%; height: 50dvh; }
  .chat-area { height: 50dvh; }
}
